package com.tsingteng.cosfun.ui.search;

import com.tsingteng.cosfun.bean.BaseDataBean;
import com.tsingteng.cosfun.bean.FollowBean;
import com.tsingteng.cosfun.bean.SearchResp;
import com.tsingteng.cosfun.bean.SearchUserResp;
import com.tsingteng.cosfun.callback.RxObserver;
import com.tsingteng.cosfun.common.Config;
import com.tsingteng.cosfun.http.RxSchedulers;
import com.tsingteng.cosfun.mvp.module.BaseModel;

import java.util.List;

import retrofit2.Callback;

public class SearchModel extends BaseModel implements ISearchModel{

    @Override
    public void searchUser(String search,int pageNo, RxObserver<SearchResp> callBack) {
        doRxRequest().getSearchUserResp(search,pageNo,Config.PAGE_THIRTY).compose(RxSchedulers.io_main()).subscribe(callBack);
    }

    @Override
    public void getInitUser(int type,int page_no, RxObserver<SearchResp> callBack) {
       doRxRequest().getSearchList(type,page_no, Config.PAGE_FIFTY).compose(RxSchedulers.io_main()).subscribe(callBack);
    }
    @Override
    public void getFollowNotification(String id, Callback<BaseDataBean<FollowBean>> callback) {
        doRxRequest().followPerson(id).enqueue(callback);
    }
    @Override
    public void getNoFollowNotification(String follow_id, RxObserver<FollowBean> callback) {
        doRxRequest().getNoFollow(follow_id).compose(RxSchedulers.io_main()).subscribe(callback);
    }
}
